package com.ruoyi.project.lely.bean.entity;

import com.baomidou.mybatisplus.annotation.*;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.time.LocalDateTime;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import org.hibernate.validator.constraints.Length;

/**
 * 用户表单
 *
 * @author luoyong
 */
@Builder
@AllArgsConstructor
@NoArgsConstructor
@Data
@TableName(value = "`ly_user_formid`", autoResultMap = true)
public class LyUserFormid {


    @ApiModelProperty("ID")
    @TableId("id")
    private Long id;


    @Length(max = 63, message = "缓存的FormId长度不能超过63位")
    @NotEmpty
    @ApiModelProperty("缓存的FormId")
    @TableField(value = "`formId`")
    private String formId;


    @NotNull
    @ApiModelProperty("是FormId还是prepayId")
    @TableField(value = "`isprepay`")
    private Integer isprepay;


    @NotNull
    @ApiModelProperty("可用次数，fromId为1，prepay为3，用1次减1")
    @TableField(value = "`useAmount`")
    private Integer useAmount;


    @NotNull
    @ApiModelProperty("过期时间，腾讯规定为7天")
    @TableField(value = "`expire_time`")
    private LocalDateTime expireTime;


    @Length(max = 63, message = "微信登录openid长度不能超过63位")
    @NotEmpty
    @ApiModelProperty("微信登录openid")
    @TableField(value = "`openId`")
    private String openId;


    @ApiModelProperty("创建时间")
    @TableField(value = "`create_time`", fill = FieldFill.INSERT)
    private LocalDateTime createTime;


    @ApiModelProperty("更新时间")
    @TableField(value = "`update_time`", fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime updateTime;


    @ApiModelProperty("逻辑删除")
    @TableField(value = "`deleted`", fill = FieldFill.INSERT)
    private Integer deleted;

}
